package com.gzx.qc.xxljob;

import com.gzx.qc.modular.asr.service.GzxAsrService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import vip.xiaonuo.common.tenant.TenantContext;

/**
 * @author zjt
 * @description
 * @date 2025/7/29 16:06
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class AsrXxlJob {

    private final GzxAsrService asrService;

    /**
     * ASR任务创建
     */
    @XxlJob("asrTextProcessJobHandler")
    public void asrTextProcess() {
        TenantContext.ignoreHandle(asrService::asrTextProcess);
    }

    /**
     * ASR任务查询
     */
    @XxlJob("syncAsrTextJobHandler")
    public void syncAsrText() {
        TenantContext.ignoreHandle(asrService::syncAsrText);
    }

    /**
     * 分析ASR文本
     */
    @XxlJob("unparkVoiceTextJobHandler")
    public void unparkVoiceText() {
        TenantContext.ignoreHandle(asrService::unparkVoiceText);
    }
}
